-
-
Notifications
You must be signed in to change notification settings - Fork 14k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mpv: don't use generated luasocket #89145
Conversation
The luarocks version of luasocket crashes if the host program has symbols with the same name as luasocket, such as "socket_create". This change makes mpv use a custom luasocket derivation that isn't built from luarocks. This new derivation has the same code as "luaPackages.luasocket" before commit 274715c. Closes NixOS#88584
@cript0nauta Are you able to explain why does the version we ship is not good enough? I mean, what has changed between the two that made the version you suggest here better? I noticed you use This PR reminds me of #80528 . Although it seemed promising, @teto opposed to add a secondary version of the same Luarocks package to the collection. I'm afraid I tend to agree with them, because the changes we suggest fix the issue at hand but they add up to the maintenance burden. |
Unfortunately, I haven't determined the root cause of the issue yet. What I do know is that when mpv uses the luarocks version of luasocket, it will crash when a script tries to listen on a socket. This happens in Arch Linux too, and only when I'm using luarocks. So my guess is that the bug is either mpv's, luasocket's or luarocks' fault. I don't think this is a problem of
Fair enough. I understand having duplicated luasocket versions could be counterproductive. But I don't have a better idea of how could be #88584 fixed without disabling samba support (which I don't use nor consider important, but I guess some users might). I'll keep investigating the issue to see if I can fix the root cause of the bug instead of doing this duplicated versions hack, but I'm not sure if I'm going to accomplish something. |
if the luarocks version of luasocket is too old, can't they do another release ? alternatively we could switch to a fork on luarocks since it's clearer to swap sources than having 2 luasockets in nixpkgs. |
@teto this is not about the version being used, (I don't know why @cript0nauta chose to use the What makes the difference is the use of What I pick out of this, is the fact we are facing issues with some Luarocks modules that don't play nice with In #85103 I proposed to write a common interface for all languages that will allow to handle the discovery of languages' modules solely via environmental variables and Nix attributes - without relying on what #85103 will have to go through an RFC and all that... and unfortunately I won't have time to work on it until the summer. In the meantime, I'm adding this issue / PR to the list of issues declarative wrappers will be able to solve. |
I had a look at the rockspec and contrary to luv's case, it doesn't seem to need any specific config. |
Apparently mpv won't use samba anymore: mpv-player/mpv@3b8b7cb. This commit is in master but not released yet. This means the issue I reported will go away in the next mpv version. I still want to know why this happens so I'll keep investigating. But at least I know in a few weeks (based on mpv's relased cycle) I won't be experiencing this bug and there won't be a duplicated luasocket package in nixpkgs! |
I finally discovered the root cause of the bug! It turns out that the github version of luasocket is compiled with I'm closing this PR as I'll open another one disabling samba suport in mpv (and also packaging simple-mpv-webui that was the reason I found the issue). |
Awesome 👏 . |
makes sense considering your bug report xD thanks for having looked into it. |
The luarocks version of luasocket crashes if the host program has
symbols with the same name as luasocket, such as "socket_create".
This change makes mpv use a custom luasocket derivation that isn't built
from luarocks. This new derivation has the same code as
"luaPackages.luasocket" before commit
274715c.
Closes #88584
Motivation for this change
mpv compiled with samba support crashed when using a luasocket script. See #88584. This PR fixes the issue without disabling samba.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)